package top.shiyiri.dao.impl;

import top.shiyiri.dao.BaseDao;
import top.shiyiri.dao.OrderDao;
import top.shiyiri.pojo.Order;

/**
 * @author Aunean
 * @date 2022/2/10 11:24
 */
public class OrderDaoImpl extends BaseDao implements OrderDao {

    @Override
    public int saveOrder(Order order) {
        System.out.println("OrderDaoImpl 程序在【"+Thread.currentThread().getName()+"】中");

        String sql = "insert into t_order(`order_id`, `create_time`, `price`, `status`, `user_id`) values(?,?,?,?,?)";
        return update(sql, order.getOrderId(), order.getCreateTime(), order.getPrice(), order.getStatus(), order.getUserId());
    }
}
